<template>
  <div id="app">
    <!-- 顶部横条 -->
    <div class="topbar">
        <div class="topbarLogo">
          <img width="48" height="48" src="../assets/logo.png" alt="Logo">
          <span>链接桥</span>
        </div>
        <div class="topbarMenuitems">
          <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
            <el-menu-item index="0" @click="openHome">综合数据</el-menu-item>
            <el-menu-item index="1" @click="openVideo">视频推广</el-menu-item>
            <el-menu-item index="2" @click="openGame">小游戏推广</el-menu-item> 
            <el-menu-item index="3" @click="openSoft">软件安装推广</el-menu-item>
            <el-menu-item index="4" @click="openNew">新闻</el-menu-item>
            <el-menu-item index="5" @click="openLog">KOL</el-menu-item>
            <el-menu-item index="6" @click="openLog">个人信息</el-menu-item>
          </el-menu>
        </div>
        <div class="topbarUserinfo">
          <!-- 用户信息展示 -->
          <p>用户名：John Doe</p>
          <p>邮箱：johndoe@example.com</p>
        </div>
    </div>
    <div class="top-warning">
      <span>本网站不提供兑换服务!!! 不提供充值服务!!! 不提供定价服务!!! 不提供虚拟货币违法业务!!!</span>
    </div>

    <div class="layout-mid">
    <!-- 大屏滚动广告 -->
      <div class="ad-banner">
      <!-- 这里可以放置图片、视频或滚动文本等广告内容 -->
        <el-carousel :interval="2000" type="card">
          <el-carousel-item class="test">
            <span>积分提取无时间限制</span>
          </el-carousel-item>
          <el-carousel-item>
            <span>闲暇时间赚积分,无任何充值功能</span>
          </el-carousel-item>
          <el-carousel-item class="test">
            <span>每个按钮都触发积分奖励</span>
          </el-carousel-item>
          <el-carousel-item>
            <img src="../assets/btc.webp" alt="图片加载失败">
          </el-carousel-item>
          <el-carousel-item>
            <span>目前支持SOL, EOS, TRX, BSC, DFS链</span>
            <span>SOL链 支持的币为bonk</span>
            <span>EOS链 支持的币为usdt</span>
            <span>TRX 支持的币为BTT</span>
            <span>BSC 支持的币为SHIB</span>
            <span>BSC 支持的币为SATS</span>
          </el-carousel-item>
        </el-carousel>
      </div>

      <!-- 功能跳转页 -->
      <div class="content">
        <!-- 这里可以根据需要动态加载不同的功能组件 -->
        <router-view></router-view>
      </div>
      <div class="footer">
        <a href="http://beian.miit.gov.cn/">蜀ICP备2024095793号</a>
      </div>
    </div>
  </div>
</template>

<script>
import { ElCarousel, ElCarouselItem } from 'element-plus';
export default {
  components: {
    ElCarousel,
    ElCarouselItem
  },
  name: 'App',
  // 其他 Vue 实例选项和逻辑...
  methods: {
    openHome(key, keyPath){
      this.$router.push('/home')
    },
    openVideo(key, keyPath){
      this.$router.push('/video')
    },
    openGame(key, keyPath){
      this.$router.push('/game')
    },
    openSoft(key, keyPath){
      this.$router.push('/soft')
    },
    openLog(key, keyPath){
      this.$router.push('/log')
    },
  }
}
</script>

<style scoped>

.top-warning {
  background-color: red;
  font-weight: bolder;
  padding: 0px;
  color: white;
  font-size: 16px;
}

.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: gray;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: gray;
}

#app {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgb(137, 237, 202);
  color: white;
  height: 60px;
}

.topbarMenuitems {
  background-color: pink;
  width: 400px;
}

.topbarUserinfo {
  background-color: pink;
  color: black;
}

.ad-banner {
  flex: 2;
  background-color: pink;
  /* display: flex; */
  justify-content: center;
  align-items: center;
  font-size: 24px;
  width: 1400px;
  padding-left: 20px;
  padding-right: 20px;
}

.content {
  flex: 4; 
  padding: 20px;
  background-color: pink;
  width: 1400px;
}

.layout-mid {
  display: flex;
  flex: 6;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 2px;
}

</style>
